package cn.java75.printer2;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author oldliu
 * @since 1.0
 */
@Service
public class Printer {

    @Value("惠普添彩系列")
    private String brand;
    @Value("1499")
    private int money;

    @Autowired
    @Qualifier("blackInk")
    private Ink ink;

    @Resource(name = "b5")
    private TextPaper paper;
    public Printer(){

    }

    public Printer(String brand, int money) {
        this.brand = brand;
        this.money = money;
    }

    public void print(String content){
        System.out.println("这个一台价值"+this.money+"元的"+brand+"打印机！");
        System.out.println("用"+ink.getColor()+"来打印：");
        paper.print(content);
    }

}
